home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / include / oasys.h < prev    next >
C/C++ Source or Header  |  1992-09-11  |  4KB  |  153 lines

  1. /* Oasys object format header file for BFD.
  2.    Contributed by Cygnus Support.  */
  3.  
  4. #define OASYS_MAX_SEC_COUNT 16
  5. /* **** */
  6.  
  7. typedef struct oasys_archive_header {
  8.   uint32_type  version;
  9.   char create_date[12];
  10.   char revision_date[12];
  11.   uint32_type mod_count;
  12.   uint32_type mod_tbl_offset;
  13.   uint32_type sym_tbl_size;
  14.   uint32_type sym_count;
  15.   uint32_type sym_tbl_offset;
  16.   uint32_type xref_count;
  17.   uint32_type xref_lst_offset;
  18. } oasys_archive_header_type;
  19.  
  20. typedef struct oasys_extarchive_header {
  21.   char version[4];
  22.   char create_date[12];
  23.   char revision_date[12];
  24.   char mod_count[4];
  25.   char mod_tbl_offset[4];
  26.   char sym_tbl_size[4];
  27.   char sym_count[4];
  28.   char sym_tbl_offset[4];
  29.   char xref_count[4];
  30.   char xref_lst_offset[4];
  31. } oasys_extarchive_header_type;
  32.  
  33. typedef struct oasys_module_table {
  34.   int32_type mod_number;
  35.   char mod_date[12];
  36.   int32_type mod_size;
  37.   int32_type dep_count;
  38.   int32_type depee_count;
  39.   int32_type file_offset;
  40.   int32_type sect_count;
  41.   char *module_name;
  42.   uint32_type module_name_size;
  43. } oasys_module_table_type;
  44.  
  45.  
  46. typedef struct oasys_extmodule_table_a {
  47.   char mod_number[4];
  48.   char mod_date[12];
  49.   char mod_size[4];
  50.   char dep_count[4];
  51.   char depee_count[4];
  52.   char sect_count[4];
  53.   char file_offset[4];
  54.   char mod_name[32];
  55. } oasys_extmodule_table_type_a_type;
  56.  
  57. typedef struct oasys_extmodule_table_b {
  58.   char mod_number[4];
  59.   char mod_date[12];
  60.   char mod_size[4];
  61.   char dep_count[4];
  62.   char depee_count[4];
  63.   char sect_count[4];
  64.   char file_offset[4];
  65.   char mod_name_length[4];
  66. } oasys_extmodule_table_type_b_type;
  67.  
  68.  
  69. typedef enum oasys_record {
  70.   oasys_record_is_end_enum = 0,
  71.   oasys_record_is_data_enum = 1,
  72.   oasys_record_is_symbol_enum = 2,
  73.   oasys_record_is_header_enum = 3,
  74.   oasys_record_is_named_section_enum = 4,
  75.   oasys_record_is_com_enum = 5,
  76.   oasys_record_is_debug_enum = 6,
  77.   oasys_record_is_section_enum = 7,
  78.   oasys_record_is_debug_file_enum = 8,
  79.   oasys_record_is_module_enum = 9,
  80.   oasys_record_is_local_enum = 10
  81. } oasys_record_enum_type;
  82.  
  83.   
  84.  
  85. typedef struct oasys_record_header {
  86.   uint8_type length;
  87.   int8_type check_sum;
  88.   int8_type type;
  89.   int8_type fill;
  90. } oasys_record_header_type;
  91.  
  92. typedef struct oasys_data_record {
  93.   oasys_record_header_type header;
  94.   uint8e_type relb;
  95.   uint8e_type addr[4];
  96.   uint8e_type data[256];
  97. } oasys_data_record_type;
  98.  
  99. typedef struct oasys_header_record {
  100.   oasys_record_header_type header;
  101.   int8_type version_number;
  102.   int8_type rev_number;
  103.   char module_name[26-6];
  104.   char description[64-26];
  105. } oasys_header_record_type;
  106.  
  107. #define OASYS_VERSION_NUMBER 0
  108. #define OASYS_REV_NUMBER 0
  109. typedef struct oasys_symbol_record {
  110.   oasys_record_header_type header;
  111.   int8e_type relb;
  112.   int8e_type value[4];
  113.   int8e_type refno[2];
  114.   char name[64];
  115. } oasys_symbol_record_type;
  116.  
  117. typedef int8e_type relocation_byte;
  118.  
  119. #define RELOCATION_PCREL_BIT 0x80
  120. #define RELOCATION_32BIT_BIT 0x40
  121. #define RELOCATION_TYPE_BITS 0x30
  122. #define RELOCATION_TYPE_ABS 0x00
  123. #define RELOCATION_TYPE_REL 0x10
  124. #define RELOCATION_TYPE_UND 0x20
  125. #define RELOCATION_TYPE_COM 0x30
  126. #define RELOCATION_SECT_BITS 0x0f
  127.  
  128. typedef struct oasys_section_record {
  129.   oasys_record_header_type header;
  130.   uint8e_type relb;
  131.   int8_type value[4];
  132.   int8_type vma[4];
  133.   int8_type fill[3];
  134. } oasys_section_record_type;
  135.  
  136. typedef struct oasys_end_record {
  137.   oasys_record_header_type header;
  138.   uint8e_type relb;
  139.   int8e_type entry[4];
  140.   int8e_type fill[2];
  141.   int8e_type zero;
  142. } oasys_end_record_type;
  143.  
  144. typedef union oasys_record_union {
  145.   oasys_record_header_type header;
  146.   oasys_data_record_type data;
  147.   oasys_section_record_type section;
  148.   oasys_symbol_record_type symbol;
  149.   oasys_header_record_type first;
  150.   oasys_end_record_type end;
  151.   uint8e_type pad[256];
  152. } oasys_record_union_type;
  153.